#include "SceneTestApp.hpp"
#include "SceneHandlerTest.hpp"
#include "DrawHandlerTest.hpp"
#include "KeyboardHandler_test.hpp"
#include "DragableTest.hpp"

namespace yep
{
SceneTestApp SceneTestApp::_instance;

SceneTestApp::SceneTestApp():
    Application("Scene2dTest", "Tests the main functionalities from Scene2d class")
{
}

SceneTestApp::~SceneTestApp()
{
}

Scene &SceneTestApp::getFirstScene()
{
    _scene.add(*new SceneHandlerTest);
    vector<Color> colors = {Color::LIGHT_RED, Color::LIGHT_GREEN, Color::LIGHT_BLUE, Color::LIGHT_CYAN, Color::LIGHT_PURPLE, Color::LIGHT_YELLOW};
    for (size_t i = 0; i < colors.size(); ++i)
    {
        // (i%2<<2)-1 -> se i é par? então -1 senão 1. Logo temos -1, 1, -1.
        _scene.add(*new DrawHandlerTest(Vector2(32+16*i, 32+16*i), Vector2(64,64), colors[i], ((int)i%2<<1)-1) );
    }
    _scene.add(*new KeyboardHandlerTest);
    _scene.add(*new DragableTest(Vector2(320,100)));
    _scene.add(*new DragableTest(Vector2(320,316)));
    return _scene;
}

}
